import { pushMacroTask, pushMicroTask } from "./eventLoop.js";

console.log("主任务");

pushMicroTask(function () {
  console.log("微任务1");
});

pushMacroTask(function () {
  console.log("宏任务1");

  pushMicroTask(function () {
    console.log("微任务3");

    pushMicroTask(function () {
      console.log("微任务5");
    });
  });

  pushMacroTask(function () {
    console.log("宏任务2");
  });

  pushMicroTask(function () {
    console.log("微任务4");
  });

  pushMacroTask(function () {
    console.log("宏任务3");
  });
});

pushMicroTask(function () {
  console.log("微任务2");
});

console.log("主任务1");
